#! /bin/bash

if [ $# -ne 1 ]
then
  echo 'arguments must be one'
  exit
fi

currentDir=`pwd`
outputDir=$currentDir/out
for file in `ls $1`
do
  if [ ${file#*.} = 'c' ]
  then
    gcc $currentDir/$1/$file -o $outputDir/$file.out;
  fi
done
